import { exportUrl, getStatusList } from "@/api/loadMaterial/mesLoadMaterialVerification"
// 列表头按钮配置
export const operateList = [
  {
    name: $i18n.t("common.export"),
    type: "primary",
    icon: "el-icon-download",
    handleName: "export", //点击时返回的标识
    url: exportUrl
    //auth: "auth:operlog:export", //权限字段
  }
  // {
  //     name: "新增",
  //     type: "primary",
  //     icon: "el-icon-circle-plus-outline",
  //     handleName: 'add', // 点击时返回的标识
  //     // auth: "auth:user:add", //权限字段
  // },
  // {
  //     name: '删除',
  //     type: 'danger',
  //     icon: 'el-icon-delete',
  //     handleName: 'delete',
  //     isMultiple: true, // isSingle 表示必须选择一项//isMultiple: true, // 表示必须多选
  //     // auth: "auth:user:delete", //权限字段
  // }
]
// 行末按钮配置
export const rowConfig = [
  {
    name: $i18n.t("common.view"),
    type: "primary",
    class: "row-btn-primary",
    handleName: "show" //点击时返回的标识
  }
  // {
  //     name: "修改",
  //     type: "primary",
  //     class: "row-btn-primary",
  //     handleName: "edit", //点击时返回的标识
  // },
  // {
  //     name: "批量新增",
  //     type: "primary",
  //     class: "row-btn-primary",
  //     handleName: "multiAdd", //点击时返回的标识
  // }
]
// 搜索条件配置
export const searchConfig = {
  inline: true,
  formDesc: {
    verificationCode: {
      type: "input",
      label: $i18n.t("mesLoadMaterialVerification.productWorkOrder")
    },
    // saleCode: {
    //     type: "input",
    //     label: "销售订单编码",
    // },
    planCode: {
      type: "input",
      label: $i18n.t("mesLoadMaterialVerification.productOrder")
    },
    status: {
      type: "select",
      label: $i18n.t("mesLoadMaterialVerification.status"),
      prop: {
        value: "value",
        text: "description"
      },
      options: async (data) => {
        const list = await getStatusList()
        return list.data.result
      }
    }
  }
}
// 新增/删除表单配置
export const formDescDialog = {
  span: 24,
  disabled: true,
  isShowSubmitBtn: false,
  formDesc: {
    verificationCode: {
      type: "input",
      label: $i18n.t("mesLoadMaterialVerification.verificationCode"),
      layout: 12,
      required: false
    },
    // saleCode: {
    //     type: "input",
    //     label: "销售订单",
    //     layout:  12,
    //     required: false,
    // },
    planCode: {
      type: "input",
      label: $i18n.t("mesLoadMaterialVerification.productOrder"),
      layout: 12,
      required: false
    },
    orderCode: {
      type: "input",
      label: $i18n.t("mesLoadMaterialVerification.productWorkOrder"),
      layout: 12,
      required: false
    },
    planDate: {
      type: "date",
      label: $i18n.t("mesLoadMaterialVerification.planDate"),
      layout: 12,
      required: false,
      attrs: {
        valueFormat: "yyyy-MM-dd"
      }
    },
    workshopCode: {
      type: "input",
      label: $i18n.t("common.workshopCode"),
      layout: 12,
      required: false
    },
    workshopName: {
      type: "input",
      label: $i18n.t("common.workshopName"),
      layout: 12,
      required: false
    },
    lineCode: {
      type: "input",
      label: $i18n.t("common.lineCode"),
      layout: 12,
      required: false
    },
    lineName: {
      type: "input",
      label: $i18n.t("common.lineName"),
      layout: 12,
      required: false
    },
    processCode: {
      type: "input",
      label: $i18n.t("common.processCode"),
      layout: 12,
      required: false
    },
    processName: {
      type: "input",
      label: $i18n.t("common.processName"),
      layout: 12,
      required: false
    },
    status: {
      type: "select",
      label: $i18n.t("mesLoadMaterialVerification.status"),
      layout: 12,
      required: false,
      prop: {
        value: "value",
        text: "description"
      },
      options: async (data) => {
        const list = await getStatusList()
        return list.data.result
      }
    },
    startTime: {
      type: "datetime",
      label: $i18n.t("mesLoadMaterialVerification.startTime"),
      layout: 12,
      required: false,
      attrs: {
        valueFormat: "yyyy-MM-dd HH:mm:ss"
      }
    },
    endTime: {
      type: "datetime",
      label: $i18n.t("mesLoadMaterialVerification.endTime"),
      layout: 12,
      required: false,
      attrs: {
        valueFormat: "yyyy-MM-dd HH:mm:ss"
      }
    },
    remark: {
      type: "textarea",
      label: $i18n.t("common.remark"),
      layout: 24,
      required: false
    }
  }
}
